module.exports = function(sequelize, DataTypes) {
    const originalLedger = sequelize.define('originalLedger', {
        id: {
            type: DataTypes.BIGINT(20).UNSIGNED,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
            readonly: true
        },
        organization_id: {
            type: DataTypes.BIGINT(20).UNSIGNED,
            allowNull: false,
        },
        key: {
            type: DataTypes.STRING,
            allowNull: false,
        }, //文件标识
        'name': {
            type: DataTypes.STRING
        }, //仪器名称
        brand: {
            type: DataTypes.STRING
        }, //品牌
        asset_number: {
            type: DataTypes.STRING
        }, //资产编号
        model_number: {
            type: DataTypes.STRING
        }, //型号
        serial_number: {
            type: DataTypes.STRING
        }, //序列号
        department: {
            type: DataTypes.STRING
        }, //科室
        localtion: {
            type: DataTypes.STRING
        }, //安装地点
        install_date: {
            type: DataTypes.STRING
        }, //安装日期
        purchased_date: {
            type: DataTypes.STRING
        }, //购置日期
        amount: {
            type: DataTypes.STRING
        }, //数量
        price: {
            type: DataTypes.STRING
        }, //金额
        manufacturer: {
            type: DataTypes.STRING
        }, //生产厂商
        supplier: {
            type: DataTypes.STRING
        }, //供应商
        startDate: {
            type: DataTypes.STRING
        }, //启用日期
        accept_date: {
            type: DataTypes.STRING
        }, //验收日期
        years: {
            type: DataTypes.STRING
        }, //折旧年限
        salvage: {
            type: DataTypes.STRING
        }, //残值率
        memo: {
            type: DataTypes.STRING
        }, //备注
        user_defined: {
            type: DataTypes.TEXT
        }, //自定义字段
        created_by: {
            type: DataTypes.BIGINT(20).UNSIGNED,
            allowNull: false,
            readonly: true
        },
        updated_by: {
            type: DataTypes.BIGINT(20).UNSIGNED,
        }
    }, {
        tableName: 'sophic_original_ledgers',

        underscored: true,


        classMethods: {

            operationLog: true,

            associate: function(models) {}
        }
    });

    return originalLedger;
};